<?php
function oh_query_parse($query) {		
	$i = array();
	$i['query'] = $query;
	if (strpos($query,":")!==FALSE) {
		$i['command'] = substr($query,0,strpos($query,":"));
		$i['payload'] = substr($query,strpos($query,":")+1);
	} else {
		$i['command'] = $query;
		$i['payload'] = "";	
	}
	if (strpos($i['command'],".")===FALSE) {
		$i['command'] = str_replace("_",".",$i['command']);
	} else {
		# nothing
	}
	$i['tokens'] = explode(".",$i['command']);
	$i['module'] = strtolower($i['tokens'][0]);
	return $i;
}
